<%-- 
    Document   : cargar_catalogo
    Created on : 03-ene-2013, 0:16:27
    Author     : Cannibal-Slayer
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" session="true" import="java.util.*" import="recursos.*" import="CapaLogica.*"%>




        <%


            int tipo = Integer.parseInt(request.getParameter("tipo"));
            out.print(tipo);
            interfaz_com com = new interfaz_com();
            LinkedList<articulo_carrito> catalogo = com.enviar_categoria(tipo);
            session.setAttribute("catalogo", catalogo);
           
            String col_izq = "<article class=\"col1\">", col_der = "<article class=\"col1 pad_left1\">";
            boolean izq_der = true;
            for (articulo_carrito articulo : catalogo) {
                //IMPRIMIR ARTICULOS DEL LADO IZQUIERDO
                if (izq_der) {
                    col_izq += "<div class=\"wrapper pad_bot1\">"
                            + " <figure class=\"left marg_right1\"><a href=\"#\"><img src=\"" + articulo.articuloimagen + "\" alt=\"\"></a></figure>"
                            + "<a href=\"#\" onmouseover=\"ajax_showTooltip(window.event,'demo-pages/info_articulo.jsp?id2=" + articulo.articuloCodigo + "',this);return false\" >" + articulo.articuloNombre + "</a>"
                            + "<p><strong>Precio:<strong> " + articulo.articuloPrecio + "</p>"
                            + "<button type=\"button\" onclick=\"loadXMLDoc(" + articulo.articuloCodigo + ")\">Agregar a Carrito</button>"
                            + "</div><br><br>";
                    izq_der = false;
                } //IMPRIMIR ARTICULOS DEL LADO DERECHO
                else {
                    col_der += "<div class=\"wrapper pad_bot1\">"
                            + " <figure class=\"left marg_right1\"><a href=\"#\"><img src=\"" + articulo.articuloimagen + "\" alt=\"\"></a></figure>"
                            + "<a href=\"#\" onmouseover=\"ajax_showTooltip(window.event,'demo-pages/info_articulo.jsp?id2=" + articulo.articuloCodigo + "',this);return false\" >" + articulo.articuloNombre + "</a>"
                            + "<p><strong>Precio:<strong> " + articulo.articuloPrecio + "</p>"
                            + "<button type=\"button\" onclick=\"loadXMLDoc(" + articulo.articuloCodigo + ")\">Agregar a Carrito</button>"
                            + "</div><br><br>";
                    izq_der = true;
                }


            }

            col_izq += "</article>";
            col_der += "</article>";
            out.print(col_izq);
            out.print(col_der);

        %>

